Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

Latest commit

 

History

History
10 lines (8 loc) · 493 Bytes

6.7.1 - swoole_serialize::pack.md

File metadata and controls

10 lines (8 loc) · 493 Bytes

swoole_serialize::pack

将PHP变量序列化,函数原型:

function swoole_serialize::pack(mixed $data, int $flags = 0);
  • $data 为要进行序列化的变量,请注意functionresource类型的变量是不支持序列化的
  • $flags 是否启用快速模式,swoole_serialize默认会使用静态表保存关联数组的Key,设置此参数为SWOOLE_FAST_PACK后将不再保存数组key
  • 序列化成功后返回二进制字符串,失败返回false